package controle;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.swing.JOptionPane;

import modelo.Aluno;

public class DeletarAluno {

	public void deletarCliente(long cpf) {

		EntityManagerFactory factory = Persistence
				.createEntityManagerFactory("curso");
		EntityManager manager = factory.createEntityManager();
		manager.getTransaction().begin();
		Aluno f = manager.find(Aluno.class, cpf);

		manager.remove(f);
		JOptionPane.showMessageDialog(null, "Aluno deletado com suceso!");

		manager.getTransaction().commit();
		factory.close();

	}

}
